﻿<!--
Copyright © Pavel Fedarovich, 2010-2012

This file is part of AvalonWizard.
 
You may at your option receive a license to Avalon Wizard under 
either the terms of the Apache License version 2.0 or 
the GNU Lesser General Public License (LGPL) version 2.1 or any later version.
 
AvalonWizard is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
You may obtain a copy of the Apache License at [http://www.apache.org/licenses/LICENSE-2.0].
You may obtain a copy of the LGPL at [http://www.gnu.org/licenses/].
-->
<Window 
    x:Class="AvalonWizardSample.MainWindow" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:aw="http://schemas.pavel.fedarovich.com/winfx/2010/xaml/presentation" 
    Icon="wizard.ico" Title="Avalon Wizard Sample" 
    Height="350" Width="525" Left="100" Top="100">
    <Grid>
        <aw:Wizard Name="wizard" aw:Designer.PageIndex="0">
            <aw:Wizard.Resources>
                <Style TargetType="aw:WizardPage">
                    <Setter Property="Padding" Value="14" />
                </Style>
            </aw:Wizard.Resources>
            <aw:WizardPage Header="Page 1: My Title" aw:Wizard97.Subtitle="My Subtitle" aw:Wizard97.Icon="Wizard.png">
                <Grid>
                    <Grid.Resources>
                        <Style TargetType="TextBlock">
                            <Setter Property="Margin" Value="5" />
                            <Setter Property="VerticalAlignment" Value="Center" />
                        </Style>
                        <Style TargetType="ComboBox">
                            <Setter Property="Margin" Value="5" />
                        </Style>
                        <Style TargetType="TextBox">
                            <Setter Property="Margin" Value="5" />
                        </Style>
                    </Grid.Resources>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Row="0" Grid.Column="0">Theme</TextBlock>
                    <ComboBox Name="cmbWizardStyle" Grid.Row="0" Grid.Column="1" SelectedIndex="0" SelectedValue="{Binding RelativeSource={RelativeSource AncestorType=aw:Wizard}, Path=WizardStyle, Mode=TwoWay}">
                        <ComboBox.ItemTemplate>
                            <DataTemplate DataType="aw:WizardStyle">
                                <TextBlock Text="{Binding}" />
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>
                    <TextBlock Grid.Row="1" Grid.Column="0">Aero Glow</TextBlock>
                    <ComboBox Name="cmbAeroGlowStyle" Grid.Row="1" Grid.Column="1" SelectedIndex="0" SelectedValue="{Binding RelativeSource={RelativeSource AncestorType=aw:Wizard}, Path=(aw:AeroWizard.GlowStyle), Mode=TwoWay}">
                        <ComboBox.ItemTemplate>
                            <DataTemplate DataType="aw:AeroGlowStyle">
                                <TextBlock Text="{Binding}" />
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>
                    <TextBlock Grid.Row="2" Grid.Column="0">Wizard Title</TextBlock>
                    <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, 
                                Path=Title, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                    <TextBlock Grid.Row="3" Grid.Column="0">Page Title</TextBlock>
                    <TextBox Grid.Row="3" Grid.Column="1" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type aw:WizardPage}}, 
                                Path=Header, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                    <TextBlock Grid.Row="4" Grid.Column="0">Page Subtitle</TextBlock>
                    <TextBox Grid.Row="4" Grid.Column="1" Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type aw:WizardPage}}, 
                                 Path=(aw:Wizard97.Subtitle), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                </Grid>
            </aw:WizardPage>
            <aw:WizardPage Header="Page 2: Page Properties">
                <StackPanel Margin="5">
                    <CheckBox Content="IsFinishPage" IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type aw:WizardPage}}, Path=IsFinishPage}" />
                    <CheckBox Content="AllowCancel" IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type aw:WizardPage}}, Path=AllowCancel}" />
                    <CheckBox Content="AllowNext" IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type aw:WizardPage}}, Path=AllowNext}" />
                    <CheckBox Content="AllowBack" IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type aw:WizardPage}}, Path=AllowBack}" />
                    <CheckBox Content="AllowFinish" IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type aw:WizardPage}}, Path=AllowFinish}" />
                    <CheckBox Content="ShowCancel" IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type aw:WizardPage}}, Path=ShowCancel}" />
                    <CheckBox Content="ShowNext" IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type aw:WizardPage}}, Path=ShowNext}" />
                    <CheckBox Content="ShowBack" IsChecked="{Binding RelativeSource={RelativeSource AncestorType={x:Type aw:WizardPage}}, Path=ShowBack}" />
                </StackPanel>
            </aw:WizardPage>
            <aw:WizardPage Header="Page 3: Next Page Selection">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Top">
                    <TextBlock Margin="0,2">Next Page:</TextBlock>
                    <ComboBox Name="cmbNextPage" Margin="10,0" HorizontalAlignment="Stretch" MinWidth="200" SelectedIndex="0" SelectionChanged="OnNextPageChanged">
                        <ComboBoxItem>Page 4: Action Buttons</ComboBoxItem>
                        <ComboBoxItem>Page 5: Custom Header Template</ComboBoxItem>
                        <ComboBoxItem>Page 6: Finish Page</ComboBoxItem>
                    </ComboBox>
                </StackPanel>
            </aw:WizardPage>
            <aw:WizardPage Header="Page 4: Action Buttons">
                <StackPanel>
                    <Button Margin="20,5" Command="{x:Static aw:WizardCommands.NextPage}">
                        Go to Next Page</Button>
                    <Button Margin="20,5" Command="{x:Static aw:WizardCommands.NextPage}" CommandParameter="5">
                        Go to Finish Page
                    </Button>
                </StackPanel>
            </aw:WizardPage>
            <aw:WizardPage Header="Page 5: Custom Header Template">
                <aw:WizardPage.HeaderTemplate>
                    <DataTemplate DataType="String">
                        <Grid Height="60">
                            <Ellipse Fill="Red" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="50, 5" />
                            <TextBlock Text="{Binding}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" FontSize="14" FontWeight="Bold" />
                        </Grid>
                    </DataTemplate>
                </aw:WizardPage.HeaderTemplate>
            </aw:WizardPage>
            <aw:WizardPage Header="Page 6: Finish Page"></aw:WizardPage>
        </aw:Wizard>
    </Grid>
</Window>